<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
        response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1
        response.setHeader("Pragma", "no-cache"); //HTTP 1.0
        response.setDateHeader("Expires", 0); //prevent caching at the proxy server

        if (session.getAttribute("id_usuario") == null) {
           response.sendRedirect("/sgd/sair.jsp");
        }
        
%>

<sql:query var="query" dataSource="jdbc/dbo_MicrosoftSQLServer">
    select dbo.fu_getMenus(?,0,0) as menu
    <sql:param value="${sessionScope.id_perfil}"/>
</sql:query>

<c:forEach var="row" items="${query.rows}">
    ${fn:replace(row.menu,'#,principal',',,')}
</c:forEach>